package com.snack.shop.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 商品实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_product")
@Schema(description = "商品表")
public class Product extends BaseEntity {

    @Schema(description = "分类ID")
    @TableField("category_id")
    @JsonProperty("categoryId")
    private Long categoryId;

    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "商品图片")
    private String image;

    @Schema(description = "价格")
    private BigDecimal price;

    @Schema(description = "原价")
    @TableField("original_price")
    @JsonProperty("originalPrice")
    private BigDecimal originalPrice;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "销量")
    private Integer sales;

    @Schema(description = "商品描述")
    private String description;

    @Schema(description = "状态：0-下架，1-上架")
    private Integer status;
}

